package com.eshop.we.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.eshop.we.book.dto.BookDto;
import com.eshop.we.book.entity.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * <p>
 * 书籍表 Mapper 接口
 * </p>
 *
 * @author anonymity
 * @since 2018-07-06
 */
@Mapper
@Component
public interface BookMapper extends BaseMapper<Book> {

   @Select("select *,(select real_name from user where id=user_id) as name from book  where is_del=0 ")
   List<BookDto> selectBookPage(Page<BookDto> page, @Param("name") String  name, @Param("bookName") String bookName,@Param("start")  Long  start,@Param("end")  Long end);
}
